package com.jash.labor.service;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.jash.labor.context.Result;
import com.jash.labor.entity.FirstParty;
import com.jash.labor.entity.StationCheckIn;
import com.jash.labor.mapper.StationCheckInMapper;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import javax.xml.crypto.Data;
import java.sql.Date;
import java.sql.Timestamp;


@Service
public class StationCheckInService {//入职
    @Resource
    private StationCheckInMapper stationCheckInMapper;
    public Object add(StationCheckIn stationCheckIn){
        stationCheckIn.setCreatetime(new Timestamp(System.currentTimeMillis()));
        stationCheckInMapper.insert(stationCheckIn);
        return Result.SUCCESS;
    }
    public Object edit(StationCheckIn stationCheckIn){
        stationCheckInMapper.updateById(stationCheckIn);
        //增删改操作 返回
        return Result.SUCCESS;
    }
    public Object queryListPage(Integer pageNo, Integer pageSize) {
        Page<StationCheckIn> page = new Page(pageNo,pageSize);
        QueryWrapper wrapper = new QueryWrapper();
        IPage iPage = stationCheckInMapper.selectPage(page,wrapper);
        return new Result<>(iPage);
    }
}
